package sg.nus.iss.vmcs.dao;

/**
 * DAO Abstract Factory for extensibility of persistent storage options.
 * Abstract methods provided for concrete factories to implement
 * @author Seng Chia How
 */
public abstract class VmcsDAOFactory {
	/** Storage Type Enumeration. Currently only Java Properties is used */
    public enum StorageType { JAVAPROPERTIES, DB }
    
	/**
	 * Gets a Store DAO for retrieval of Stores and Store Items
	 * @return StoreDAO
	 */
	public abstract StoreDAO getStoreDAO();
	
	/**
	 * Gets a CoinRegistryDAO for retrieval of Coins
	 * @return
	 */
	public abstract CoinRegistryDAO getCoinRegistryDAO();
	
	/**
	 * Static method that returns a factory of the required type
	 * @param type Storage Type
	 * @return Concrete DAO Factory
	 */
	public static VmcsDAOFactory getDAOFactory(StorageType type) {
		 switch (type) {
	      	case JAVAPROPERTIES: 
	      		return PropertyDAOFactory.getInstance();
	      	case DB: //Provided for illustration purposes
	      		return null;
	      	default: 
	      		return null;
		 }
	}
}
